<?php

namespace App\Http\Controllers\Chanjet;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class TplusSaleInvoiceInfo extends BaseController
{
    protected static $Field = [
        "voucher_id" => "SaleInvoice.ID",

        //"warehouse_name" => "PurchaseInvoice.PurchaseInvoiceDetails.Warehouse.Name", 仓库名
        "inventory_name" => "SaleInvoice.SaleInvoiceDetails.Inventory.Name",
        "unit" => "SaleInvoice.SaleInvoiceDetails.Unit.Name",
        "quantity" => "SaleInvoice.SaleInvoiceDetails.Quantity",
        "taxRate" => "SaleInvoice.SaleInvoiceDetails.TaxRate",
        "OrigTaxPrice|decimal" => "SaleInvoice.SaleInvoiceDetails.OrigTaxPrice",
        "OrigTaxAmount|decimal" => "SaleInvoice.SaleInvoiceDetails.OrigTaxAmount",
        "ts" => "SaleInvoice.SaleInvoiceDetails.Ts",
        //"archive_spec" => "",
    ];

    /**
     * 列表 仍然查询列表
     */
    public function getlist(Request $request)
    {
        $memberinfo = $this->mangerinfo;

        $isgetall = $request->isgetall ?? 0;

//        $pid = $request->pid ?? 0;
//        $request
        $list = \App\Models\Chanjet\TplusSaleInvoice::getList($request, $memberinfo, $isgetall);


        return response()->json(['code' => '000', 'msg' => '操作成功', 'data' => $list]);
    }
}
